package com.fzhucc.modules.businessCard.service;

import com.fzhucc.modules.businessCard.domain.dto.BusinessCardAddDto;
import com.fzhucc.modules.businessCard.domain.dto.BusinessCardDto;
import com.fzhucc.modules.businessCard.domain.dto.BusinessCardEditDto;
import com.fzhucc.modules.businessCard.domain.dto.BusinessCardQueryCriteria;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
* @description 服务接口
* @author yyg
* @date 2022-10-24
**/
public interface BusinessCardService {

    /**
    * 查询数据分页
    * @param criteria 条件
    * @param pageable 分页参数
    * @return Map<String,Object>
    */
    Map<String,Object> queryAll(BusinessCardQueryCriteria criteria, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param criteria 条件参数
    * @return List<BusinessCardDto>
    */
    List<BusinessCardDto> queryAll(BusinessCardQueryCriteria criteria);

    /**
     * 根据ID查询
     * @param id ID
     * @return BusinessCardDto
     */
    BusinessCardDto findById(Integer id);

    /**
    * 创建
    * @param resources /
    * @return BusinessCardDto
    */
    BusinessCardDto create(BusinessCardAddDto resources);

    /**
    * 编辑
    * @param resources /
    */
    void update(BusinessCardEditDto resources);

    /**
    * 多选删除
    * @param ids /
    */
    void deleteAll(Integer[] ids);

    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
    void download(List<BusinessCardDto> all, HttpServletResponse response) throws IOException;

    /**
     * 上传名片头像
     */
    Map<String, String> douploadpic(MultipartFile photo, Integer id);

    /**
     * 获取QRcode
     */
    String makeQRcode(Integer business_card_id);

    /**
     * 同步名片
     */
    Map<String, String> dosynchronizationExpert();
}